﻿using System;
using System.Threading.Tasks;

namespace Sidvall.Devices
{
    public interface IGeolocator
    {
        /// <summary>
        /// The accuracy level at which the Geolocator provides location updates.
        /// </summary>
        PositionAccuracy DesiredAccuracy { get; set; }
        /// <summary>
        /// Gets or sets the desired accuracy in meters for data returned from the location
        /// service.
        /// </summary>
        uint? DesiredAccuracyInMeters { get; set; }
        /// <summary>
        /// The status that indicates the ability of the Geolocator to provide location updates.
        /// </summary>
        PositionStatus LocationStatus { get; }
        /// <summary>
        /// Gets and sets the distance of movement, in meters, relative to the coordinate
        /// from the last PositionChanged event, that is required for the Geolocator to raise
        /// a PositionChanged event.
        /// </summary>
        /// <value>
        /// The distance of required movement, in meters, for location services to raise
        /// a PositionChanged event. The default value is 0.
        /// </value>
        double MovementThreshold { get; set; }
        /// <summary>
        /// The requested minimum time interval between location updates, in milliseconds.
        /// If your application requires updates infrequently, set this value so that location
        /// services can conserve power by calculating location only when needed.
        /// </summary>
        /// <value>
        /// The requested minimum time interval between location updates.
        /// </value>
        uint ReportInterval { get; set; }

        /// <summary>
        /// Starts an asynchronous operation to retrieve the current location of the device.
        /// </summary>
        Task<Geoposition> GetGeopositionAsync();
        Task<Geoposition> GetGeopositionAsync(TimeSpan maximumAge, TimeSpan timeout);
    }
}
